module.exports = app => {
    const { STRING } = app.Sequelize; 

    const Clazz = app.model.define('clazz',{
        category:STRING
    })

    Clazz.associate = () => {
        app.model.Clazz.hasMany(app.model.Book, {  //设置外键
            foreignKey: 'clazz_id',
            targetKey: 'id'
        })
    }

    return Clazz;

}